import { ref } from 'vue';
import { createGlobalState } from '@vueuse/core';

// 用户store
export const useWindow = createGlobalState(() => {
    const windowDict = ref<AnyObject>({
        winWidth: window.innerWidth,
        winHight: window.innerHeight,
    });
    window.addEventListener('resize', () => {
        windowDict.value = {
            winWidth: window.innerWidth,
            winHight: window.innerHeight,
        };
    });
    
    return { windowDict };
});

